local skel = fk.CreateSkill{--定义
  name = "knu__sheju",
}

Fk:loadTranslationTable{--翻译
  ["knu__sheju"] = "慑惧",
  [":knu__sheju"] = "当你受到伤害后，你可以拼点，没赢的角色视为使用一张【逐近弃远】。",

  ["#knu__sheju"] = "慑惧：你可以拼点，没赢的角色视为使用一张【逐近弃远】",

  ["$knu__sheju1"] = "何故如此，咄咄逼人呐！",
  ["$knu__sheju2"] = "如何无道，枉杀无辜啊！",

}

skel:addEffect(fk.Damaged, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name)
  end,
  on_cost = function (self, event, target, player, data)
    local players = table.filter(player.room:getOtherPlayers(player),function (p)
      return player:canPindian(p)
    end)
    local tos = player.room:askToChoosePlayers(player,{
      targets = players,
      min_num = 1,
      max_num = 1,
      skill_name = skel.name,
      prompt = "#knu__sheju",
    })
    if #tos > 0 then
      event:setCostData(self,{tos = tos})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = event:getCostData(self).tos[1]
    local pindian = player:pindian({to}, skel.name)
    local list = {}
    if pindian.results[to].winner == player then
      list = {to}
    elseif pindian.results[to].winner == to then
      list = {player}
    else
      list = {player,to}
    end
    for _,p in ipairs(list) do
      if p:canUse(Fk:cloneCard("chasing_near")) then
        room:askToUseVirtualCard(p,{
          name = "chasing_near",
          skill_name = skel.name,
          cancelable = false,
        })
      end
    end
  end,
})

return skel